<!--
Author: W3layouts
Author URL: http://w3layouts.com
-->
<!doctype html>
<html lang="en">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>我预定的景点/特色</title>
    <!-- google-fonts -->
    <link href="//fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap"
        rel="stylesheet">
    <!-- //google-fonts -->
    <!-- Template CSS Style link -->
    <link rel="stylesheet" href="/static/assets/css/style-starter.css">
    <link href="/static/hAdmin/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="/static/hAdmin/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
</head>

<body>
    <!--header-->
    <header id="site-header" class="fixed-top">
        <div class="container">
            <nav class="navbar navbar-expand-lg stroke">
                <h1>
                    <a class="navbar-brand" href="/web/pagesIndex">
                        <img class="img-fluid" style="width: 70px;height: 70px;" src="/static/assets/images/logo.jpg" alt=" "> 高邮文化宣传站
                    </a>
                </h1>
                <!-- if logo is image enable this
    <a class="navbar-brand" href="#index.html">
        <img src="image-path" alt="Your logo" title="Your logo" style="height:35px;" />
    </a> -->
                <button class="navbar-toggler  collapsed bg-gradient" type="button" data-toggle="collapse"
                    data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false"
                    aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon fa icon-expand fa-bars"></span>
                    <span class="navbar-toggler-icon fa icon-close fa-times"></span>
                </button>

                <div class="collapse navbar-collapse" id="navbarTogglerDemo02">
                    <ul class="navbar-nav ml-lg-auto">
                        <li class="nav-item ">
                            <a class="nav-link" href="/web/pagesIndex">主页 <span class="sr-only">(current)</span></a>
                        </li>

                        <li class="nav-item">
                            <a class="nav-link" href="/web/courses">景点/特色</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/web/contact">留言</a>
                        </li>
                        <li class="nav-item active">
                            <a class="nav-link" href="/web/myCourse">我预定的景点/特色</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/web/personal">个人中心</a>
                        </li>
                        <!-- search button -->
                        <div class="search-right">
                            <a href="javascript:void(0)" id="logout" class="btn button-style" title="退出登录">退出登录</a>
                            <!-- search popup -->
                            <div id="search" class="pop-overlay">
                                <div class="popup">
                                    <h4 class="search-pop-text-w3 text-white text-center mb-4">Search Here Your
                                        Online Course
                                    </h4>
                                    <form action="#error" method="GET" class="search-box">
                                        <div class="input-search"> <span class="fa fa-search mr-2"
                                                aria-hidden="true"></span><input type="search"
                                                placeholder="Enter Keyword" name="search" required="required"
                                                autofocus="">
                                        </div>
                                        <button type="submit" class="btn button-style">Search</button>
                                    </form>
                                </div>
                                <a class="close" href="#close">×</a>
                            </div>
                            <!-- //search popup -->
                        </div>
                        <!-- //search button -->
                    </ul>
                </div>
                <!-- toggle switch for light and dark theme -->
                <div class="cont-ser-position">
                    <nav class="navigation">
                        <div class="theme-switch-wrapper">
                            <label class="theme-switch" for="checkbox">
                                <input type="checkbox" id="checkbox">
                                <div class="mode-container">
                                    <i class="gg-sun"></i>
                                    <i class="gg-moon"></i>
                                </div>
                            </label>
                        </div>
                    </nav>
                </div>
                <!-- //toggle switch for light and dark theme -->
            </nav>
        </div>
    </header>
    <!--//header-->
    <!-- inner banner -->
    <div class="inner-banner">
        <section class="w3l-breadcrumb">
            <div class="container">
                <h4 class="inner-text-title font-weight-bold mb-sm-3 mb-2">我预定的景点/特色</h4>
                <ul class="breadcrumbs-custom-path">
                    <li><a href="/web/pagesIndex">主页</a></li>
                    <li class="active"><span class="fa fa-chevron-right mx-2" aria-hidden="true"></span>我预定的景点/特色</li>
                </ul>
            </div>
        </section>
    </div>
    <!-- //inner banner -->
    <!-- about section -->
    <div id="listBody">

    </div>

    <!-- //about section -->


    <!-- Js scripts -->
    <!-- move top -->
    <button onclick="topFunction()" id="movetop" title="Go to top">
        <span class="fa fa-level-up" aria-hidden="true"></span>
    </button>
    <script>
        // When the user scrolls down 20px from the top of the document, show the button
        window.onscroll = function () {
            scrollFunction()
        };

        function scrollFunction() {
            if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
                document.getElementById("movetop").style.display = "block";
            } else {
                document.getElementById("movetop").style.display = "none";
            }
        }

        // When the user clicks on the button, scroll to the top of the document
        function topFunction() {
            document.body.scrollTop = 0;
            document.documentElement.scrollTop = 0;
        }
    </script>
    <!-- //move top -->
    <!-- magnific popup -->
    <script src="/static/assets/js/jquery.magnific-popup.min.js"></script>

    <!-- //magnific popup -->
    <!-- common jquery plugin -->
    <script src="/static/assets/js/jquery-3.3.1.min.js"></script>
    <!-- //common jquery plugin -->

    <!-- theme switch js (light and dark)-->
    <script src="/static/assets/js/theme-change.js"></script>

    <!-- //theme switch js (light and dark)-->

    <!-- magnific popup -->
    <script src="/static/assets/js/jquery.magnific-popup.min.js"></script>

    <!-- //magnific popup -->

    <!-- MENU-JS -->

    <!-- //MENU-JS -->

    <!-- for testimonials carousel -->
    <script src="/static/assets/js/owl.carousel.js"></script>

    <!-- //for testimonials carousel -->

    <!-- disable body scroll which navbar is in active -->
    <script>
        $(function () {
            $('.navbar-toggler').click(function () {
                $('body').toggleClass('noscroll');
            })
        });
    </script>
    <!-- //disable body scroll which navbar is in active -->

    <!-- counter for stats -->
    <script src="/static/assets/js/counter.js"></script>
    <!-- //counter for stats -->
    <script src="/static/hAdmin/js/jquery.min.js?v=2.1.4"></script>
    <!--bootstrap-->
    <script src="/static/assets/js/bootstrap.min.js"></script>
    <!-- //bootstrap-->
    <!-- //Js scripts -->
    <script src="/static/hAdmin/js/plugins/toastr/toastr.min.js"></script>
    <script src="/static/hAdmin/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="/static/js/GloJs.js"></script>
    <span id="gloUrl" style="display: none"></span>
    <script>


        $(function () {

            let Glo_BaseUrl = $("#gloUrl").attr("gloUValue")
            let Glo_user = localStorage.getItem("userId")
            let currentPage = $("#pageHelper").attr("currentPage");


            function getContractList() {
                let total = 0;//总数
                let pageSize = 99;//每页条数
                let html_dom = $("#listBody")

let role = localStorage.getItem("role")
                let userId = Glo_user
                if (role !== "1"){
                    userId = ""
                }
                setTimeout(function () {
                    $.ajax({
                        url: Glo_BaseUrl + "/order/list",
                        type: "get",
                        data: {
                            "pageSize": pageSize,
                            "pageNum": 1,
                            "userId": userId,

                        },
                        success: function (data) {
                            let ListStr = ''
                            total = data.total
                            for (let i = 0; i < data.list.length; i++) {
                                let item = data.list[i]
let btnstr = ` `
                                if (item.status == '已支付'){
                                    btnstr += `

<br>下单时间： ${item.createTime}
                                    支付时间： ${item.updateTime}`
                                }else {
                                    btnstr = `
<a href="javascript:void(0)" class="btn button-style mt-sm-5 mt-4 orderStatus"  thisId="${item.id}">支付<i
                                    class="fa fa-check" aria-hidden="true"></i></a><br>下单时间： ${item.createTime}`
                                }
                                ListStr +=
                                    `  <section class="w3l-text-6 py-5" id="about">
            <div class="text-6-mian py-md-4 py-3">
                <div class="container">
                    <div class="row top-cont-grid align-items-center">
                        <div class="col-lg-6 left-img pr-lg-4">
                            <img src="${item.pic}" style="width: 350px;height: 350px;" alt="" class="img-responsive img-fluid" />
                        </div>
                        <div class="col-lg-6 text-6-info mb-lg-0 mb-4 pl-lg-5">
                            <h6>${item.courseName}(${item.status})</h6>
                            <h2>价格：${item.price} <span></span></h2>
                            <p>${item.content}.</p>
                            <a href="/web/courseDetail" class="btn button-style mt-sm-5 mt-4 seeDetail"  thisId="${item.courseId}">查看详情<i
                                    class="fa f-double-right" aria-hidden="true"></i></a>
                            `+btnstr+`
                        </div>
                    </div>
                </div>
            </div>
        </section>
                `
                            }

                            if (data.code !== 500) {
                                html_dom.html("")
                                html_dom.append(ListStr)
                                getRoleSetMenu()
                            } else {
                                alert("获取失败")
                            }
                            total = data.total
                            $("#data_total").html(data.total);

                            //编辑
                            $(".seeDetail").unbind().click(function () {
                                localStorage.setItem("id", $(this).attr("thisId"));

                            });
      //支付
                            $(".orderStatus").unbind().click(function () {
                                let id = $(this).attr("thisId")
                                var formData = new FormData();//这里需要实例化一个FormData来进行文件上传
                                formData.append("status", '已支付');

                                formData.append("id", id);

                                $.ajax({
                                    url: Glo_BaseUrl + "/order/edit",
                                    type: "post",
                                    data: formData,
                                    processData: false,
                                    contentType: false,
                                    success: function (data) {
                                        windowsAuto(data.code, data.msg)
                                        getContractList()
                                    },
                                    error: function () {
                                        alert("服务器异常！network error！")
                                    }
                                })
                            });





                        },
                        error: function () {
                            alert("服务器异常！network error！")
                        }
                    });
                }, 300)
            }

            //*******************************************
            getContractList(2)

            // 退出登录
            $("#logout").click(function (){
                $.ajax({
                    url: Glo_BaseUrl + "/admin/logout",
                    type: "get",
                    data: {

                    },
                    success: function (data) {
                        location.reload()
                        localStorage.removeItem("dept")
                        localStorage.removeItem("userId")
                    },
                    error: function () {
                        alert("服务器异常！network error！")
                    }
                })
            })
        })

    </script>
</body>

</html>
